package com.cjkj.system.api;

import com.cjkj.common.core.constant.SecurityConstants;
import com.cjkj.common.core.constant.ServiceNameConstants;
import com.cjkj.common.core.domain.R;
import com.cjkj.system.api.domain.APITJ03BpData;
import com.cjkj.system.api.domain.APITJ03EcgData;
import com.cjkj.system.api.domain.APITJ03HrData;
import com.cjkj.system.api.domain.APITJ03RealTimeData;
import com.cjkj.system.api.domain.request.RecordsReq;
import com.cjkj.system.api.factory.RemoteTJ03DataServiceFallbackFactory;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.*;

import java.util.List;

@FeignClient(contextId = "remoteTJ03DataService",value = ServiceNameConstants.EQUIPMENT_SERVICE, fallbackFactory = RemoteTJ03DataServiceFallbackFactory.class )
public interface RemoteTJ03DataService {

    /**
     * 查询多参数监测仪心率监测数据
     * @param req
     */
    @PostMapping("/report/tj03HrData")
    R<List<APITJ03HrData>> tj03HrRecords(@RequestBody RecordsReq req, @RequestHeader(SecurityConstants.FROM_SOURCE)String source);

    /**
     * 查询最新一条心率数据
     * @param req
     */
    @PostMapping("/report/tj03LatestHrData")
    R<APITJ03HrData> tj03LatestHrData(@RequestBody RecordsReq req, @RequestHeader(SecurityConstants.FROM_SOURCE)String source);

    /**
     * 查询多参数监测仪心率监测数据
     * @param req
     */
    @PostMapping("/report/tj03BpData")
    R<List<APITJ03BpData>> tj03BpRecords(@RequestBody RecordsReq req, @RequestHeader(SecurityConstants.FROM_SOURCE)String source);
    /**
     * 查询多参数监测仪心电监测数据
     * @param req
     */
    @PostMapping("/report/tj03ECGData")
    R<List<APITJ03EcgData>> tj03ECGRecords(@RequestBody RecordsReq req, @RequestHeader(SecurityConstants.FROM_SOURCE)String source);

    /**
     * 获取小程序实时数据
     * @param reqs
     */
    @PostMapping("/report/getTj03RealTimeData")
    R<APITJ03RealTimeData> getTj03RealTimeData(@RequestBody List<RecordsReq> reqs, @RequestHeader(SecurityConstants.FROM_SOURCE)String source);

    /**
     * 获取多参数监测仪最新电量数据
     * @param equipmentNo 设备号
     */
    @GetMapping("/equipment/getTJ03LatestBatteryData")
    R<APITJ03RealTimeData> getLatestBatteryData(@RequestParam("equipmentNo") String equipmentNo, @RequestHeader(SecurityConstants.FROM_SOURCE)String source);

    /**
     * 获取多参数监测仪最新监测数据
     * @param equipmentNo 设备号
     */
    @GetMapping("/equipment/getTJ03LatestData")
    R<APITJ03RealTimeData> getTJ03LatestData(@RequestParam("equipmentNo") String equipmentNo, @RequestHeader(SecurityConstants.FROM_SOURCE)String source);
}
